#include "Stat.h"
#include "Node.h"

Stat::Stat() {
	type_ = NODE_STAT;
	valType_ = VAL_NONE;
}

Stat::~Stat() {
}

void Stat::createStat(VAL_TYPE valType) {
	valType_ = valType;
}

bool Stat::getValue(int &val) {
	if (valType_ != Stat::VAL_INT)
		return false;
	val = valInt_;
	return true;
}
bool Stat::getValue(double &val) {
	if (valType_ != Stat::VAL_DOUBLE)
		return false;
	val = valReal_;
	return true;
}
bool Stat::getValue(string &val) {
	if (valType_ != Stat::VAL_STRING)
		return false;
	val = valStr_;
	return true;
}

bool Stat::setValue(int val) {
	if (valType_ != Stat::VAL_INT)
		return false;
	valInt_ = val;
	return true;
}
bool Stat::setValue(double val) {
	if (valType_ != Stat::VAL_DOUBLE)
		return false;
	valReal_ = val;
	return true;
}
bool Stat::setValue(string val) {
	if (valType_ != Stat::VAL_STRING)
		return false;
	valStr_ = val;
	return true;
}

Tag::Tag() {
	type_ = NODE_TAG;
}

Tag::~Tag() {
}
